home *** CD-ROM | disk | FTP | other *** search
QuickBASIC Tokenized Source | 1989-12-04 | 2.5 KB | 34 lines |
- Bytes
- RealValue
- AsLong
- Strout
- SignBit
- Exponent
- Mant1
- FLPT.BASt
- Displays how a given real value is stored in memory.
- Internal format of IEEE number (all values in hexadecimal)
- Get the value and calculate the address of the variable.
- Enter a real number (or END to quit):
- Convert the real value to a long without changing any of
- the bits.
- Make a string of hex digits, and add leading zeroes.y
- Save the sign bit, and then eliminate it so it doesn't
- affect breaking out the bytes
- Split the real value into four separate bytes
- --the AND removes unwanted bits; dividing by 256 shifts
- the value right 8 bit positions.
- Display how the value appears in memory.g
- Bytes in Memory"
- High Low
- Set the value displayed for the sign bit.
- The exponent is the right seven bits of byte 3 and thes
- leftmost bit of byte 2. Multiplying by 2 shifts left and
- makes room for the additional bit from byte 2.s
- The first part of the mantissa is the right seven bitsn
- of byte 2. The OR operation makes sure the implied bit
- is displayed by setting the leftmost bit.
- Bit 31 Bits 30-23 Implied Bit & Bits 22-0
- Sign Bit Exponent Bits Mantissa Bits"
- MHex$ makes sure we always get two hex digits.
-